package vista;

import controlador.Controlador;
import modelo.Modelo;

/**
 *
 * @author jjcamacho
 */
public abstract class AbstractVistaImp<C extends Controlador, M extends Modelo> extends javax.swing.JPanel
        implements Vista<C, M> {

    M modelo;
    C controlador;

    @Override
    public C getController() {
        return controlador;
    }

    @Override
    public M getModel() {
        return modelo;
    }

    @Override
    public void setController(C controlador) {
        this.controlador = controlador;
    }

    @Override
    public void setModel(M modelo) {
        this.modelo = modelo;
    }

    @Override
    public void dataModelChanged() {
        refresh();
    }

    @Override
    public void display() {
        refresh();
    }

    public abstract void refresh();
}
